package com.yeziji.common.business.dataMessage.entity;

import com.mybatisflex.annotation.Table;
import com.yeziji.common.CommonEntity;
import com.yeziji.utils.NanoIdUtils;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

import java.io.Serializable;

/**
 * 消息记录表 实体类。
 *
 * @author system
 * @since 2024-10-29
 */
@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@Table("data_message_record")
public class DataMessageRecordEntity extends CommonEntity implements Serializable {
    private static final long serialVersionUID = -7661167144588252379L;

    /**
     * 消息上报 IP
     */
    private String ip;

    /**
     * 消息主题
     */
    private String topic;

    /**
     * 消息唯一键
     */
    private String flagId;

    /**
     * 消费信息
     */
    private String message;

    /**
     * 消息相关数据
     */
    private String correlationData;

    /**
     * 消息状态：DataSyncStatusEnum
     */
    private Integer status;

    /**
     * 重试次数
     */
    private Integer retryCount;

    /**
     * 消息消费间隔
     */
    private Integer sleepTime;

    public static void main(String[] args) {
        System.out.println(NanoIdUtils.randomNotSymbolNaoId(16));
    }
}
